package ru.study.thinkin.chapter7;

class WithFinals{
	 private final void f() {
		System.out.println("with finals f()");
	}
	private void g() {
		System.out.println("withfinals g()");
	}
}

class OverridingPrivate extends WithFinals {
	
	private final void f() {
		System.out.println("OverridingPrivate f()");
	}
	public void g() {
		System.out.println("OverridingPrivate g()");
	}
}

class OverridingPrivate2 extends OverridingPrivate {
		
	public final void f() {
		System.out.println("OverridingPrivate2 f()");
	}
	public void g() {
		System.out.println("OverridingPrivate2 g()");
	}
	public void gg() {
		super.g();
	}
}

public class FinalOverloading {

	public static void main(String[] args) {
		OverridingPrivate2 op2 = new OverridingPrivate2();
				
		op2.f();
		op2.g();
		op2.gg();
		
		OverridingPrivate op = op2;
		//!op.f();
		WithFinals wf = op2;
		//!wf.g();

	}

}
